<template>
    <div>
        <h2>Parent - Parent - 父组件</h2>
        <p>
            <input type="text" v-model="msg">
        </p>
        <p>
            <button @click="changeCount(100)">count Add </button>
        </p>
        <p>
            <button @click="changeShow()">点击修改show </button>
        </p>
        <p>
            {{flag?'今天天气很美好':'明天希望不要下雨...'}}
        </p>
        <hr>
        <ChildOne
            id="2107"
            :count="count"
            :msg="msg"
            ref="cone"
            v-model="flag"
            
        ></ChildOne>
        <ChildTwo
            :changeCount="changeCount"
            @changemyself="change"
            v-model="msg"
            
        >
            <div>
                <h2>Hello WH2107</h2>
                <h2>I love you CHina </h2>
            </div>
        </ChildTwo>
    </div>
</template>

<script>
export default {
    data(){
        return {
            count:2000,
            msg:"2107-daydayup",
            flag:true 
        }
    },
    methods:{
        changeShow(){
            this.$refs.cone.show = !this.$refs.cone.show;
            this.$refs.cone.todoaction()
        },
        changeCount(n){
            this.count += n ;
        },
        change(msg){
            this.msg = msg;
        }
    }
}
</script>